<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		var a=10;
		//console.log(a);//window.a
		//console.log(window);	//{a:20} obj.a

		var length=10;
		function enjoy(){//1001
			console.log(this.length);
		}
		var stu={
			length:20,
			enjoy:enjoy,
			say:function(fun){//fun:1001
				console.log(this.length);
				fun();//window
			}
		}

		stu.say(enjoy);

		//enjoy();//window.enjoy()
		//stu.enjoy();







		/*

		1!+...10!

		10!:10*9*8*7*6*5...*1=10*9!
		9!:9*8*7*...*1

		*/

		function sum(n){
			if(n<=1){
				return 1
			}else{
				/*return n*sum(n-1);*/
				return n*arguments.callee(n-1)
			}
		}

		var result=sum(4);
		//console.log(result);


		var o={}
		console.log(o);
		function sayHello(a,b){
			//1.var a; var b;
			/*2.1-》arguments[0]
				2->argumentrs[1]
				3->arguments[2]
				...
				5->arguments[4]

				3.arguments[0]->a
				  arguments[1]->b



			*/

			
			console.log(arguments.callee);
		}

		sayHello(1,2,3,4,5);











		/*
		解析：
			function say(){
				alert("hello say---");
			}
			var run;
			say();
			run();
			run=function(){}



		*/
		//say()
		//run();
		//console.log(run);
		function say(){
			//alert("hello say---");
		}
		/*var run=function(){
			alert("run-----");
		}*/
		/*console.log(say);
		console.log(run);*/













		var obj={
			name:'lisi',
			height:'180cm'
		}

		Object.defineProperty(obj,"gender",{
			set:function(v){
				console.log("开始设置gender----");
				this._gender=v;

			},
			get:function(){
				console.log("获取gender---");
				return this._gender;
			}
		});

		obj.gender='men';
		//console.log(obj.gender);

	/* Object.defineProperty(obj,"age",{
	 	value:'20',
	 	writable:true,
	 	enumberable:true,
	 	configurable:true
	 });*/

	 //delete obj.age;
	 //obj.age=30;
	/*console.log(obj);
		for(var key in obj){
			console.log(obj[key]);
		}*/







	</script>
</head>
<body>
	
</body>
</html>